package com.kaifamiao.www.demo.Do18;

import java.util.Scanner;

public class Ex02 {
    public static void main(String[] args) {
        System.out.print("请输入行数；");
        Scanner input = new Scanner(System.in);
        int row = input.nextInt();
        for (int i = 1;i <= row;i++){
            for (int j = 1;j <=row - i;j++){
                System.out.print(" ");
            }
            for (int k = 1;k <= 2*i-1;k++){
                if(k == 1 || k == (2*i-1) || i == row ){
                    System.out.print("*");
                }else{
                    System.out.print(" ");
                }
            }System.out.println();
        }

    }
}
